from rftp import RFtp



ftp = RFtp(host='172.22.102.202')
ftp.login(username='wangqiang', pwd='wangqiang')
path = '/Project/Switch/DLINK-ME/Firmware/B037'
dirs = ftp.get_dirlist_in_path(path)
for d in dirs:
    print(d)
    dirs_2 = ftp.get_dirlist_in_path(d)
    for d_2 in dirs_2:
        print('\t%s' %d_2)
        files = ftp.get_filelist_in_path(d_2)
        for f in files:
            print('\t\t%s' %f)
    files = ftp.get_filelist_in_path(d)
    for f in files:
        print('\t%s'%f)

